﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="aa.aspx.vb" Inherits="App_Test_aa" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>


    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.3.min.js"></script>

<script>
    
    jQuery(function ($) {
        $.extend({
            serializeJSON: function (obj) {
                var t = typeof (obj);
                if (t != "object" || obj === null) {
                    // simple data type
                    if (t == "string") obj = '"' + obj + '"';
                    return String(obj);
                } else {
                    // array or object
                    var json = [], arr = (obj && obj.constructor == Array);

                    $.each(obj, function (k, v) {
                        t = typeof (v);
                        if (t == "string") v = '"' + v + '"';
                        else if (t == "object" & v !== null) v = $.serializeJSON(v)
                        json.push((arr ? "" : '"' + k + '":') + String(v));
                    });

                    return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
                }
            }
        });
    });

    var uri = 'api/products';

    $(document).ready(function () {

        uri = '/Webservice/Folder.asmx/aaa';
      // Send an AJAX request
        $.ajax({
            url: uri,
            type: "POST",
            contentType: "application/json; charset=utf-8",
            //dataType: "json",
            data: $.serializeJSON({
                t: "casa"
            }),
            //data: '{"id":"' + data.r.attr("id") + '", "type": "' + stringa + '", "tree_type": "' + data_type + '"}',
            success: function (r) {
                alert(r.d);
            }
        });
    });


  </script>

</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="ScmMain">
        </asp:ScriptManager>
        <div>


                        <App:PostWrite runat="server" ID="CtrAutoPost" Title="Send Message" EnabledToAccount="false" EnabledMedia="true" />

                        <App:PostWrite runat="server" ID="CtrAutoPost2" Title="Send Message" EnabledToAccount="false" EnabledMedia="true" />

            <asp:Button ID="Button1" runat="server" Text="Button" />



        </div>
    </form>
</body>
</html>
